<template>
  <div ref="print" v-show="isPreview">
    <div class="print-wrap-body" style="width:99%; margin: 10px auto 0;">
      <table style="border-collapse: collapse" width="100%">
        <tbody>
          <tr height="50px">
            <td rowspan="1" colspan="11" valign="center" style="font-weight: 700; font-size: 16px; text-align: center; width: 100%;">索赔旧件装箱&amp;检验单</td>
          </tr>
          <tr height="40px">
            <td rowspan="1" colspan="4" valign="center" style="font-weight: 400; font-size: 14px; text-align: left; width: 34%; border-bottom: solid #000000 1px">服务中心代码：{{list[0] ? list[0].ownerCode : ''}}</td>
            <td rowspan="1" colspan="2" valign="center" style="font-weight: 400; font-size: 14px; text-align: left; width: 40%; border-bottom: solid #000000 1px">服务中心名称：{{list[0] ? list[0].dealerName : ''}}</td>
            <td rowspan="1" colspan="4" valign="center" style="font-weight: 400; font-size: 14px; text-align: left; width: 26%; border-bottom: solid #000000 1px">索赔旧件月份：{{nowTime}}</td>
          </tr>
          <tr height="25px">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; width: 4%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">序号</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; width: 8%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">车型名称</td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; width: 12%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">索赔单号</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; width: 10%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">旧件编码</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; width: 23%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">旧件名称</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; width: 17%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">责任商编码</td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; width: 5%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">数量</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; width: 5%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">箱号</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; width: 8%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">实收数量</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; width: 8%; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">鉴定结果</td>
          </tr>
          <tr height="25px" v-for="(item,index) in list" :key="index">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{index+1}}</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{item.modelName}}</td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{item.claimNo}}</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{item.partCode}}</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{item.partsName}}</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{item.responsibleCode}}</td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{item.actualPartCount}}</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px">{{item.boxNo}}</td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
          </tr>
          <tr height="25px">
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>

            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
            <td valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px; border-right: solid #000000 1px; border-left: solid #000000 1px; border-bottom: solid #000000 1px"></td>
          </tr>
          <tr height="25px">
            <td rowspan="2" colspan="3" valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px;">服务中心索赔员：</td>
            <td rowspan="2" colspan="1" valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px;"></td>
            <td rowspan="2" colspan="1" valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px;">售后审核：</td>
            <td rowspan="2" colspan="2" valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px;"></td>
            <td rowspan="2" colspan="2" valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px;">质量鉴定：</td>
            <td rowspan="2" colspan="2" valign="center" style="font-weight: 400; font-size: 12px; text-align: left; border-top: solid #000000 1px;" ></td>
          </tr>
          <tr height="25px"></tr>
        </tbody>
      </table>
    </div>
  </div>
</template>

<script>
import moment from 'moment';
export default {
  name: 'templateWaitReturnLabelList',
  props: {
    //传值 从上一页
    data: {
      type: Object,
      required: true,
      default() {
        return {};
      }
    },
    isPreview: {
      type: Boolean,
      default: true
    }
  },
  data() {
    return {
      nowTime: moment().format('YYYY-MM'),
      list: []
    };
  },
  computed: {},
  created() { },
  mounted() {
    this.list = this.data.rows;
    this.$nextTick(function () {
      //必须写
      console.log('this.list 渲染数据 =>', this.list, this.data);
      this.$emit('onPrintTable', this.$refs.print.innerHTML);
    });
    if (this.isPreview) {
      this.fillInToDom();
    }
  },
  methods: {
    fillInToDom() {
      this.isPreview = true;
    },


  }
};
</script>

<style>
</style>
